Field of the Invention
The present invention relates to an information processing apparatus and a resource management method that manage libraries that are set in class paths.
Description of the Related Art
In a Java (registered trademark) execution environment, classes (codes required in execution) are loaded by a class loader. Classes are defined by class files in JAR (Java Archive) format that are within libraries. Libraries are constituted by the class files of a plurality of classes, and are often divided by specific function. Note that a path indicating the locations of the libraries needs to be set in advance in the Java (registered trademark) execution environment as a class path. This is for the class loader, at the time of loading a class, to search the libraries that are set in the class path for the class to be loaded. Here, the class loader uses file descriptors, in order to refer to libraries and search for classes, thus the used file descriptors are consumed as resources. In a Java (registered trademark) execution environment, in order to improve performance or in order to prevent operational instability due to reference to a library being dropped, a library referred to once is referred to until the program that operates in the execution environment ends. Thus, the file descriptor consumed in order for the class loader to refer to the library will be continuously consumed until the program ends.
With an embedded device, resources available to an information processing apparatus serving as the application execution environment are restricted. A file descriptor is also a type of resource, and the number of available file descriptors is restricted. For that reason, the following is carried out. First, the developer defines an upper limit regarding the amount of resources that an application uses. Then, when a user administrator starts the application, an application management framework checks, based on the upper limit, that the amount of resources available to the information processing apparatus is not exceeded.
In terms of conventional technologies, there is a technology for detecting classes that have not been used at all and deleting libraries having classes that have not been used from the class path (e.g., Japanese Patent Laid-Open No. 2005-293084 (Patent Document 1)).
Japanese Patent Laid-Open No. 2005-293084 leaves libraries having classes that are used from the class path. In other words, when there is a large number of libraries having classes that are used from the class path, a large number of file descriptors will be consumed. Thus, when the number of available file descriptors is exceeded, startup processing is affected as a result. In particular, when the number of libraries continually increases due to software updates or function expansion, the number of consumed file descriptors will increase.